import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

/// FileName setting_input_item
///
/// @Author 陈晓星
/// @Date 2024/10/28 09:33
///
/// @Description TODO

class SettingInputItem extends StatelessWidget {
  const SettingInputItem({
    super.key,
    required this.name,
    required this.textEditingController,
    required this.focusNode,
  });

  static final double width = 45.w;

  final String name;
  final TextEditingController textEditingController;
  final FocusNode focusNode;

  @override
  Widget build(BuildContext context) {
    Color themeColor = Theme.of(context).primaryColor;
    return Padding(
      padding: EdgeInsets.fromLTRB(15.w, 10.w, 15.w, 0),
      child: Row(
        children: [
          SizedBox(
            width: width,
            child: Text(
              name,
              style: TextStyle(
                  fontSize: 15.w
              ),
            ),
          ),
          Expanded(
            child: TextField(
              controller: textEditingController,
              focusNode: focusNode,
              style: TextStyle(
                fontSize: 15.w,
              ),
              decoration: InputDecoration(
                hintText: "请输入$name",
                hintStyle: TextStyle(color: Colors.grey.withOpacity(0.2)),
                filled: true,
                fillColor: themeColor.withOpacity(0.03),
                border: OutlineInputBorder(
                    borderSide: BorderSide(width: 1.w, color: themeColor),
                    borderRadius: BorderRadius.circular(12.w)
                ),
                contentPadding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 13.w),
                isCollapsed: true,
                focusedBorder: OutlineInputBorder(
                    borderSide: BorderSide(width: 1.w, color: themeColor),
                    borderRadius: BorderRadius.circular(12.w)
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}